<template>
	<view>
		<!-- 顶部样式 -->
			<mucishead title="登录" :icon="true" color="#000"></mucishead>
			
			<view class="login">
				<view class="login-text">进入网易云</view>
				<input type="text" name="phone" id="phone" placeholder="请输入手机号" v-model="phone" />
				<input type="password"  name="password" id="password" placeholder="请输入密码" v-model="password" />
				<view class="login-button" @tap="login()">登录</view>
			</view>
	</view>
</template>

<script>
	//引入头部子组件
	import mucishead from '../../components/mucishead/mucishead.vue'
	//
	import '@/common/iconfont.css'
	//引入js文件
	import {_login} from '../../common/api.js'
	
	
	export default {
		data() {
			return {
			  phone:'',
			  password:''
			}
		},
		methods: {
			login(){
			          _login(this.phone,this.password).then(res=>{
			              if(res[1].data.code!=200){
			                  // this.pwdMessage='密码错误';
							console.log('error')
			              }
			              else{
							  console.log('ok')
			                  // this.$store.commit('addUser',res.data);
			                  // this.hiddenLogin();
			                  // this.$bus.$emit('pullResource',res.data.cookie);
			              }
			          })
			      },
		},
		components:{
			mucishead,
		}
	}
</script>

<style scoped>
	.login{
		height: 600rpx;
		background: #f7f7f7;
		margin: 0 auto;
		display: flex;
		flex-direction: column;
		justify-content: space-evenly;
	}
	.login-text{
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		font-size: 40rpx;
		font-weight: 900;
	}
	.login input{
		margin: 0 30rpx 0 30rpx;
		height: 70rpx;
		border-radius: 50rpx;
		background: #fff;
	}
	.login-button{
		width: 200rpx;
		text-align: center;
		margin: 0 auto;
	}
</style>
